package com.vehicle.domains.vo.req.vehicle;


import com.fasterxml.jackson.annotation.JsonFormat;
import com.vehicle.annotations.EnumValue;
import com.vehicle.enums.EmissionStandardEnum;
import com.vehicle.enums.FuelTypeEnum;
import com.vehicle.enums.TransportVehicleTypeEnum;
import com.vehicle.enums.UsageNatureEnum;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.Pattern;
import lombok.Data;

import java.util.Date;

@Data
@Schema(description = "新增运输车辆请求参数")
public class AddTransportVehicleReq {

    @Schema(name = "vehicleNumber", description = "车牌号（如：京A12345、沪A12345挂）")
    @NotEmpty(message = "车牌号不能为空")
    @Pattern(regexp = "^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}[A-HJ-NP-Z0-9]{4,5}[A-HJ-NP-Z0-9挂学警港澳]{1}$",
            message = "车牌号格式不正确（支持货车/挂车）")
    private String vehicleNumber;

    @Schema(name = "transportVehicleType", description = "运输车辆类型（如：重型货车、冷藏车、危险品运输车）")
    @EnumValue(enumClass = TransportVehicleTypeEnum.class, message = "运输车辆类型错误")
    private String transportVehicleType;

    @Schema(name = "registerTime", description = "注册日期（车辆在交管部门的注册日期）")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date registerTime;

    @Schema(name = "vehicleBrand", description = "车辆品牌（如：东风、解放、福田）")
    private String vehicleBrand;

    @Schema(name = "vehicleModel", description = "车辆型号（如：东风天龙KL 465马力）")
    private String vehicleModel;

    @Schema(name = "fuelType", description = "燃料类型（如：柴油、汽油、天然气、电动）")
    @EnumValue(enumClass = FuelTypeEnum.class, message = "燃料类型错误")
    private String fuelType;

    @Schema(name = "emissionStandard", description = "排放标准（如：国V、国VI、欧IV）")
    @EnumValue(enumClass = EmissionStandardEnum.class, message = "排放标准类型错误")
    private String emissionStandard;

    @Schema(name = "networkStatus", description = "联网状态（ONLINE-在线，OFFLINE-离线，默认离线）")
    private String networkStatus = "OFFLINE";

    @Schema(name = "usageNature", description = "使用性质（如：营运、非营运、租赁）")
    @EnumValue(enumClass = UsageNatureEnum.class, message = "使用性质类型错误")
    private String usageNature;

    @Schema(name = "attachedListUrl", description = "随车清单URL（存储路径）")
    private String attachedListUrl;

    @Schema(name = "drivingLicenseUrl", description = "驾驶证URL（存储路径）")
    private String drivingLicenseUrl;

    @Schema(name = "engineNo", description = "发动机编码（唯一标识）")
    @Pattern(regexp = "^[A-Z0-9-]{5,50}$", message = "发动机编码格式不正确（仅支持字母、数字、短横线）")
    private String engineNo;

    @Schema(name = "engineType", description = "发动机型号（如：潍柴WP13.500E62）")
    private String engineType;

    @Schema(name = "engineManufacturer", description = "发动机制造商名称（如：潍柴动力、玉柴机器）")
    private String engineManufacturer;

    @Schema(name = "expireTime", description = "过期时间（临时车辆必填，长期有效可不填）")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date expireTime;


    @Schema(name = "vehiclePhone", description = "车主联系电话")
    @Pattern(regexp = "^1[3-9]\\d{9}$", message = "手机号格式不正确")
    private String vehiclePhone;

    @Schema(name = "vehicleAddress", description = "车主地址或常停位置")
    private String vehicleAddress;

    @Schema(name = "ownerName", description = "车主姓名")
    private String ownerName;

    @Schema(name = "enabled", description = "启用状态（true-启用，false-禁用，默认启用）")
    private Boolean enabled = true;

    @Schema(name = "vehiclePlateColor", description = "车牌颜色（如：蓝色、黄色、新能源绿牌）")
    private String vehiclePlateColor;

    @Schema(name = "vin", description = "车辆识别代号（VIN码，17位）")
    @Pattern(regexp = "^[A-HJ-NPR-Z0-9]{17}$", message = "VIN码格式不正确（需17位字母数字组合）")
    private String vin;



}
